//
//  ErWeiMaViewController.m
//  EJLX
//
//  Created by adc on 15/11/13.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "ErWeiMaViewController.h"
#import "HomeVC.h"

@interface ErWeiMaViewController ()

@end

@implementation ErWeiMaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = RGB(240, 240, 246);
    UIView*view=[[UIView alloc]initWithFrame:CGRectMake(0, 20, WIDE, 44)];
    view.backgroundColor=RGB_COLOR(0x00c49f);
    UIButton*backBut=[[UIButton alloc]initWithFrame:CGRectMake(10,7,30,30)];
    [backBut setImage:[UIImage imageNamed:@"返回箭头"] forState:UIControlStateNormal];
    [backBut addTarget:self action:@selector(backBut) forControlEvents:UIControlEventTouchUpInside];
    [view addSubview:backBut];
    UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(WIDE/2-75, 10,150, 24)];
    label.text=@"二维码邀请注册";
    self.name.text = @"张丫丫";
    [view addSubview:label];
    [self.view addSubview:view];
    // Do any additional setup after loading the view from its nib.
    
    
    CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
    [filter setDefaults];
    NSString *str = [NSString stringWithFormat:@"%@/shop/mine_home?token=%@&page=0",HTTPS_ID,ACCESS_TOKEN]; 
    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
    
    [filter setValue:data forKey:@"inputMessage"];
    CIImage *outimg= [filter outputImage];
    
   
     _img.image = [UIImage imageWithCIImage:outimg];
    _img.layer.shadowOffset = CGSizeMake(0, 0.5);
    _img.layer.shadowRadius = 1;
    _img.layer.shadowColor = RGB_COLOR(0x00c49f).CGColor;
   
    UIImageView *small = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"1"]];
    small.frame = CGRectMake(WIDE/2-20, _img.frame.origin.y+(_img.frame.size.height/2.f-20), 40, 40);
    
    [self.view addSubview:small];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)backBut
{

    HomeVC*vc=[[HomeVC alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
   // [self.navigationController popToRootViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
